﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataAccess_Layer;
using DTO;
using System.Data;

namespace Business_Layer
{
    //1
    public static class NguyenTest_BUS
    {

        public static bool customerIsExisted(string un)
        {
            return Customer_DAC.customerIsExisted(un);
        }

        public static List<ProductWithCatNameDTO> getAllProdWithCatName()
        {
            return Product_DAC.getAllWithCatName();
        }

        public static List<CategoryDTO> getAllCategory()
        {
            return Category_DAC.getAll();
        }

        public static CustomerDTO getCusByUserName(string username)
        {
            return Customer_DAC.getByUserName(username);
        }

        public static List<BonusDTO> getBonusesByProdID(int id)
        {
            return Bonus_DAC.getBonusByProdId(id);
        }

        public static bool chargeACC(long customerID, long cardID, string cardCode)
        {
            return Customer_DAC.chargeAccount(customerID, cardID, cardCode);
        }

        public static int payoutUsingSS(long cusID, int stateID, long centerID, string productDetail, string bonusDetail, out int productIdCauseError, out int bonusIdCauseError)
        {
            return Payment_DAC.payoutUsingSS(cusID, stateID, centerID, productDetail, bonusDetail, out productIdCauseError, out bonusIdCauseError);
        }

        public static int payoutUsingBank(long cusID, int stateID, long centerID, string productDetail, string bonusDetail, out int productIdCauseError, out int bonusIdCauseError)
        {
            return Payment_DAC.payoutUsingBank(cusID, stateID, centerID, productDetail, bonusDetail, out productIdCauseError, out bonusIdCauseError);
        }

        public static List<RetailCenterDTO> getAllRetailCenter()
        {
            return RetailCenter_DAC.getAll();
        }

        public static OrderDTO getOrder(long id)
        {
            return Order_DAC.get(id);
        }

        public static List<OrderProductDetailDTO> getOrderProdDetail(long orderID)
        {
            return OrderProductDetail_DAC.get(orderID);
        }

        public static List<OrderBonusDetailDTO> getOrderBonusDetail(int orderID)
        {
            return OrderBonusDetail_DAC.get(orderID);
        }

        public static int delivery(int orderID, int centerID)
        {
            return Order_DAC.delivery(orderID, centerID);
        }

        public static List<BonusDTO> getBonusesFromProdIds(string prodIds)
        {
            return Bonus_DAC.getBonusByProdIds(prodIds);
        }

        public static BonusDTO getBonusById(int id)
        {
            return Bonus_DAC.getBonusById(id);
        }
    }
}
